package com.vito.dcs.paver.construction.service.impl;

import java.util.*;
import org.springframework.beans.factory.annotation.*;

import com.vito.dcs.paver.construction.model.DataPaverConstructionModel;
import com.vito.dcs.paver.construction.service.DataPaverConstructionService;
import com.alibaba.dubbo.config.annotation.Service;
import com.vito.dcs.paver.construction.dao.DataPaverConstructionMapper;
import com.vito.base.model.DataGrid;
import com.vito.base.factory.IDFactory;

/**
 * DataPaverConstructionService接口实现类
 * @author  fangj E-mail: 
 * @version 0.1.1
 * @date    2019-4-19 10:33:02
 */
@Service
public class DataPaverConstructionServiceImpl implements DataPaverConstructionService {
	
	@Autowired
	private DataPaverConstructionMapper datapaverconstructionMapper;
	
	@Override
	public int save(DataPaverConstructionModel datapaverconstruction){
		return datapaverconstructionMapper.save(datapaverconstruction);
	}
	@Override
	public DataGrid<DataPaverConstructionModel> queryAllByPage(DataPaverConstructionModel datapaverconstruction){
		DataGrid<DataPaverConstructionModel> dg = new DataGrid<DataPaverConstructionModel>();
		dg.setRows(datapaverconstructionMapper.queryAllByPage(datapaverconstruction));
		dg.setTotal(datapaverconstruction.getTotal());
		return dg;
	}
	@Override
	public DataPaverConstructionModel query(DataPaverConstructionModel datapaverconstruction){
		return datapaverconstructionMapper.query(datapaverconstruction);
	}
	@Override
	public Integer update(DataPaverConstructionModel datapaverconstruction){
		return datapaverconstructionMapper.update(datapaverconstruction);
	}
	
	@Override
	public Integer delete(DataPaverConstructionModel datapaverconstruction){
		return datapaverconstructionMapper.delete(datapaverconstruction);
	}

    @Override
	public int saveDataPaverConstruction(DataPaverConstructionModel datapaverconstruction){
	    datapaverconstruction.setId(IDFactory.getIDFactory().getIdInc()+"");                               
		return save(datapaverconstruction);
	}
}